package com.chenfwind.bookclub.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;

import com.chenfwind.bookclub.R;

/**
 * Created by mufeng on 2016/2/15.
 */
public class appStart extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        final View view = View.inflate(this, R.layout.activity_start,null);
        setContentView(view);

        //渐变效果
        AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);
        aa.setDuration(2000);
        view.startAnimation(aa);
        aa.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                redirectTo();
            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });
    }


    /**
     * 跳转页面
     */
    private void redirectTo(){
        Intent intent = new Intent(this , baidu.class);
        startActivity(intent);
        finish();
    }
}